package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Phone    string `gorm:"type:varchar(30);not null"`
	Password string `gorm:"type:varchar(200);not null"`
}

func (u *User) FirstUserByPhone(db *gorm.DB, phone string) error {
	return db.Debug().Where("phone=?", phone).FirstOrCreate(u).Error
}
